#ifndef _LC_MUSIC_H_
#define _LC_MUSIC_H_

#include "esp_err.h"
#include "esp_log.h"
#include "stdbool.h"
#include "board.h"
#include "file_iterator.h"
#include "media_service.h"
#include "audio_manager.h"
#include "fs_manager.h"
#include "lvgl.h"
#include "sys_app.h"

#ifdef __cplusplus
extern "C" {
#endif

#define TAG "LC_MUSIC"

typedef struct {
    uint16_t track_no;
    uint16_t sum_track_no;
    uint32_t playing : 1;
    file_iterator_instance_t *file_iterator;
} lcmusic_app_data_t;

void lcmusic_view_init(void);
void lcmusic_view_exit(void);

lcmusic_app_data_t* lcmusic_get_data(void);

void lcmusic_iterator_init(lcmusic_app_data_t* lcmusic_app_data);
void lcmusic_iterator_deinit(lcmusic_app_data_t* lcmusic_app_data);
void lcmusic_play_index(lcmusic_app_data_t* lcmusic_app_data, int index);
void lcmusic_start_play(lcmusic_app_data_t* lcmusic_app_data);
void lcmusic_stop_play(lcmusic_app_data_t* lcmusic_app_data);
void lcmusic_play_next(lcmusic_app_data_t* lcmusic_app_data);
void lcmusic_play_prev(lcmusic_app_data_t* lcmusic_app_data);

void lcmusic_media_init(lcmusic_app_data_t* lcmusic_app_data);
void lcmusic_media_deinit(lcmusic_app_data_t* lcmusic_app_data);

#ifdef __cplusplus
}
#endif

#endif /* _BT_MUSIC_H_ */
